<template>
  <div class="rankheader">
    <template>
      <div
        class="mark"
        :style="{
          backgroundImage:
            'url(' +
            list.coverImgUrl +
            '?imageView=1&type=webp&thumbnail=246x0)',
        }"
      ></div>
      <div class="detailhead">
        <img :src="list.coverImgUrl | imgURL(253)" alt="" />
        <span>
          <h1></h1>
          {{ playCount }}</span
        >
      </div>
      <div class="usermsg">
        <h1>{{ list.name }}</h1>
        <div class="user">
          <img :src="user.avatarUrl | imgURL(61)" alt="" />
          <span>{{ user.nickname }}</span>
        </div>
      </div>
    </template>
  </div>
</template>

<script>
// import Loading from "@/components/Loading.vue";
export default {
  components: {
    // Loading,
  },
  props: ["list", "showItem"],
  computed: {
    user() {
      return this.list.creator;
    },
    playCount() {
      return this.list.playCount > 10000
        ? Math.floor(this.list.playCount / 10000) + "万"
        : this.list.playCount;
    },
  },
};
</script>

<style lang="less" scoped>
.rankheader {
  display: flex;
  overflow: hidden;
  color: #fff;
  padding: 30px 15px;
  padding-top: 40px;
  position: relative;
  .mark {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.2);
    z-index: -1;
    filter: blur(30px);
    position: absolute;
    top: 0;
    left: 0;
  }
  .detailhead {
    width: 35%;
    position: relative;
    &::after {
      content: "";
      display: block;
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 18px;
      // z-index: ;
      background-image: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0.2)
      );
    }
    img {
      vertical-align: middle;
    }
    span {
      display: flex;
      z-index: 2;
      align-items: center;
      position: absolute;
      right: 5px;
      top: 0;
      font-size: 12px;
      color: #fff;
      font-size: 12px;
      text-shadow: 1px 0 0 rgba(0, 0, 0, 0.15);
      h1 {
        display: inline-block;
        margin-right: 2px;
        width: 10px;
        height: 10px;
        background-image: url("");
        background-size: 100%;
        background-position: center;
        background-repeat: no-repeat;
      }
    }
    &::before {
      content: "歌单";
      background-color: red;
      display: block;
      position: absolute;
      left: 0;
      top: 10px;
      font-size: 12px;
      padding: 0px 8px;
      border-top-right-radius: 12px;
      border-bottom-right-radius: 12px;
      opacity: 0.7;
    }
  }
  .usermsg {
    flex: 1;
    margin-left: 16px;
    padding-top: 3px;
    h1 {
      font-size: 17px;
    }
    .user {
      margin-top: 20px;
      img {
        width: 30px;
        border-radius: 50%;
        vertical-align: middle;
      }
      span {
        font-size: 14px;
        color: rgba(255, 255, 255, 0.5);
        margin-left: 5px;
      }
    }
  }
}
</style>